<template>
    <div>
        <!-- 模板中不用加.value -->
        {{ name }}      
        <input type="text" ref="inp">
        <button @click="click">click</button>
    </div>
</template>

<script>
import { ref } from 'vue'
export default {
    setup () {
        // ref(基本类型)
        const name = ref("zd")

        // ref(dom)
        const inp = ref(null)
        // 事件中需要.value
        const click = ()=>{
            name.value = "zid"
            console.log(inp.value.value);
            
        }

        return{
            name,
            inp,
            click
        }
    },

    
}
</script>

<style>

</style>